import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { resolve } from "path";
import UnoCSS from "unocss/vite";

// eslint-disable-next-line no-undef
const pathResolve = (dir) => resolve(process.cwd(), ".", dir);

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(), UnoCSS()],
  resolve: {
    alias: [
      {
        find: /@\//,
        replacement: pathResolve("src") + "/",
      },
    ],
  },
  server: {
    open: false,
    port: 8080,
  },
});
